package org.jason.model.user.pojos;

import com.baomidou.mybatisplus.annotation.*;

import java.time.LocalDateTime;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.jason.model.user.dtos.RegisterDto;

/**
 * <p>
 * 用户信息表
 * </p>
 *
 * @author jason
 * @since 2023-07-19
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("cu_user")
@ApiModel(value="CuUser对象", description="用户信息表")
public class CuUser implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "用户id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "用户名")
    @TableField("username")
    private String username;

    @ApiModelProperty(value = "手机号")
    @TableField("phone")
    private String phone;

    @ApiModelProperty(value = "密码加密盐值")
    @TableField("salt")
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private String salt;

    @ApiModelProperty(value = "密码")
    @TableField("password")
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private String password;

    @ApiModelProperty(value = "头像url")
    @TableField("image_url")
    private String imageUrl;

    @ApiModelProperty(value = "昵称")
    @TableField("nickname")
    private String nickname;

    @ApiModelProperty(value = "性别0男1女2保密")
    @TableField("sex")
    private Integer sex;

    @ApiModelProperty(value = "绑定邮箱")
    @TableField("email")
    private String email;

    @ApiModelProperty(value = "个人简介")
    @TableField("introduce")
    private String introduce;

    @ApiModelProperty(value = "(0普通用户1知名用户2官方认证）")
    @TableField("flag")
    private Integer flag;

    @ApiModelProperty(value = "积分")
    @TableField("points")
    private Integer points;

    @ApiModelProperty(value = "经验")
    @TableField("exp")
    private Integer exp;

    @ApiModelProperty(value = "账户状态0正常1已封禁")
    @TableField("status")
    private Integer status;

    @ApiModelProperty(value = "注册时间")
    @TableField(value = "created_time",fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createdTime;

    @ApiModelProperty(value = "0正常1已删除")
    @TableField("delete_flag")
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private Integer deleteFlag;
}
